<template>
  <div class="dialog-box">
    <t-dialog
      placement="center"
      :visible="props.visible"
      :header="props.title ? props.title : '提示'"
      :confirm-on-enter="true"
      :on-cancel="onCancel"
      :on-close="close"
      :on-confirm="onConfirmAnother"
      :cancelBtn="null"
      :confirmBtn="null"
    >
      <template #body>
        <p class="title1">
          <i class="doorIcon">&#xe668;</i>
          <span>{{ props.problem }}</span>
        </p>
        <p class="title2">{{ props.message }}</p>
      </template>
      <template #footer>
        <t-button @click="close" theme="default" variant="outline">{{ props.closeText }}</t-button>
        <t-button @click="ok">{{ props.submitText }}</t-button>
      </template>
    </t-dialog>
  </div>
</template>

<script setup lang="ts">
// @ts-nocheck
const props = defineProps({
  visible: {
    type: Boolean,
  },
  title: {
    type: String,
    default: '提示',
  },
  problem: {
    type: String,
    default: '是否要继续操作',
  },
  message: {
    type: String,
    default: '',
  },
  closeText: {
    type: String,
    default: '取消',
  },
  submitText: {
    type: String,
    default: '确认',
  },
});
const emit = defineEmits(['closeClick', 'submitClick']);
const onConfirmAnother = (context) => {};
const ok = (): void => {
  emit('submitClick');
};
const close = (context?: any): void => {
  emit('closeClick');
};
const onCancel = (context?: any): void => {
  console.log('555');
  emit('closeClick');
};
</script>

<style lang="less" scoped>
.dialog-box {
  position: fixed;
   z-index: 9999 !important;
  :deep(.t-dialog) {
    width: 520px; 
    z-index: 9999 !important;
  }
}
.title1 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  text-align: center;
  font-weight: 400;
  color: #333;
  line-height: 24px;
  font-family: PingFangSC-Regular, PingFang SC;
}
.title2 {
  text-align: center;
  padding-right: 8px;
  font-size: 16px;
  font-weight: 400;
  color: #666666;
  line-height: 20px;
  margin-top: 8px;
  font-family: PingFangSC-Regular, PingFang SC;
}
.doorIcon {
  font-size: 24px;
  color: RGBA(227, 115, 24, 1);
  // margin-right: 8px;
  margin-left: -40px;
}
</style>
